package com.accesshollywood.grfxOrdering.orderTreeSpecial.models;

import java.sql.SQLException;

import com.accesshollywood.SQL.GFXSQL;
import com.accesshollywood.trace.Trace;

public class ButtonAndListModel extends AbstractButtonPlusModel {
	/*
	public ButtonAndListModel() {
		super();
	}

	public ButtonAndListModel(String label) {
		super(label);
	}

	public String getName() {
		return listing.name;
	}

	public String getListingString() {
		return listing.toString();
	}

	public void setStillFolder(String UNCfilePath, int idStillList) {
		//Trace.info(UNCfilePath);
		listing.name = UNCfilePath;

		grfxItem.setApprPhotoEdit(true);

		String SQLpath = replaceAll(UNCfilePath, "\\", "\\\\");
		GFXSQL.setStillListPath(SQLpath, idStillList);
		GFXSQL.alterBoolean("item", "apprPhotoEdit", true, grfxItem.getIdItem());
		this.setEnabled(true);
	}

	public void setFootageFolder(String UNCfilePath, int idFootageList) {
		//Trace.info(UNCfilePath);
		listing.name = UNCfilePath;

		grfxItem.setApprFootage(true);

		String SQLpath = replaceAll(UNCfilePath, "\\", "\\\\");
		GFXSQL.setFootageListPath(SQLpath, idFootageList);
		GFXSQL.alterBoolean("item", "apprFootage", true, grfxItem.getIdItem());
		this.setEnabled(true);
	}

	public static String replaceAll(String source, String toReplace, String replacement) {
		int idx = source.lastIndexOf(toReplace);
		if (idx != -1) {
			StringBuffer ret = new StringBuffer(source);
			ret.replace(idx, idx + toReplace.length(), replacement);
			while ((idx = source.lastIndexOf(toReplace, idx - 1)) != -1) {
				ret.replace(idx, idx + toReplace.length(), replacement);
			}
			source = ret.toString();
		}

		return source;
	}
	
*/
}
